<!DOCTYPE html>
<html>
<head>
<title>餐桌新增</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link href="https://cdn.staticfile.org/twitter-bootstrap/5.1.1/css/bootstrap.min.css" rel="stylesheet">
    <script src="https://cdn.staticfile.org/twitter-bootstrap/5.1.1/js/bootstrap.bundle.min.js"></script>
    <script src="https://ajax.aspnetcdn.com/ajax/jquery/jquery-1.9.0.min.js"></script>
    <script src="/static/layer/layer/layer.js"></script>

</head>
<body style="">
    <div class="container p-3 my-3 " style="max-width: 600px;"  >
    <h2>餐桌新增</h2>
    <form method="post" action="/index.php/table/table_add">

      <div class="mb-3 mt-3">
        <lable for="name" class="form-label">名称(Name):</label>
        <input type="text" class="form-control" id="name" name="name" value="" placeholder="台号或包厢名称" />
      </div>

      <div class="mb-3">
        <label for="title" class="form-label">说明(Title):</label>
        <input type="text" class="form-control" id="title" name="title" value="" placeholder="说明" />
      </div>

      <div class="mb-3 mt-3">
        <lable for="name" class="form-label">适用人数(Number):</label>
        <input type="number" class="form-control" id="num_of_p" name="num_of_p" value="" placeholder="适用人数" />
      </div>    
      <div class="mb-3">
        <label for="status" class="form-label">桌子款式:</label>
          <input type="radio" class="form-check-input" id="radio3" name="type" value="1" checked /> 
          <label class="form-check-label" for="radio3">圆桌</label>
          <input type="radio" class="form-check-input" id="radio4" name="type" value="2" />
          <label class="form-check-label" for="radio4">方桌</label>
          <input type="radio" class="form-check-input" id="radio5" name="type" value="3" />
          <label class="form-check-label" for="radio5">卡座</label>      
          <input type="radio" class="form-check-input" id="radio6" name="type" value="4" />
          <label class="form-check-label" for="radio5">包厢</label>  
       </div>

      <div class="mb-3">
        <label for="status" class="form-label">是否启用:</label>
          <input type="radio" class="form-check-input" id="radio1" name="status" value="1" checked /> 
          <label class="form-check-label" for="radio1">启用</label>
          <input type="radio" class="form-check-input" id="radio2" name="status" value="2" />
          <label class="form-check-label" for="radio2">停用</label>
       </div>
      <button  type="button" class="btn btn-primary" onclick="doSave()">保存(Save)</button>

    </form>
    </div>

<script type="text/javascript">
  $(function(){



  });

  function doSave(){
    if(!$("#name").val()) {
      layer.msg("请输入餐桌或包厢名称!");
      return 0;
    }
    if(!$("#num_of_p").val()) {
      layer.msg("请输入餐桌使用人数!");
      return 0;
    }    

    //询问框
    layer.confirm('是否确定保存?', {
      btn: ['确定','取消'] //按钮
    }, function(){
      $('form').submit();
    }, function(){
      layer.msg("取消");
      return 0;
    });
  }
</script>


</body>
</html>
